package org.goodprinciples.oracolo.model;

import java.util.Objects;
import org.goodprinciples.commons.bean.CodeDescriptionBean;

/**
 *
 * @author Francesco Conte
 */
public class Object extends OracoloBean<Object> {
    
    private Long id = null;
    private Application application = null;
    private String name = null;
    private ObjectType type = null;
    
    public Object() {}

    public Application getApplication() {
        return application;
    }

    public void setApplication(Application application) {
        this.application = application;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public ObjectType getType() {
        return type;
    }

    public void setType(ObjectType type) {
        this.type = type;
    }

    public boolean equals(java.lang.Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Object other = (Object) obj;
        if (!Objects.equals(this.id, other.id)) {
            return false;
        }
        return true;
    }

    public int hashCode() {
        int hash = 5;
        hash = 17 * hash + Objects.hashCode(this.id);
        return hash;
    }

    public String toString() {
        return "Object{" + "id=" + id + ", application=" + application + ", name=" + name + ", type=" + type + '}';
    }
    
    public static enum ObjectType implements CodeDescriptionBean {
        
        SIMPLE("S", "Simple object"),
        ;
        
        private String code = null;
        private String description = null;
        
        private ObjectType(String code, String description) {
            this.code = code;
            this.description = description;
        }

        @Override
        public String getCode() {
            return code;
        }

        @Override
        public String getDescription() {
            return description;
        }

        public String toString() {
            return "ObjectType{" + "code=" + code + ", description=" + description + '}';
        }
        
    }
    
}
